package org.huangrui.redis.iomultiplex.bio.accept;

import cn.hutool.core.util.IdUtil;

import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;

/**
 * @Author hr
 * @Create 2024-05-23 23:44
 */
@SuppressWarnings("resource")
public class RedisServer {
    public static void main(String[] args) {
        try {
            ServerSocket serverSocket = new ServerSocket(6379);
            while (true){
                System.out.println("模拟RedisServer启动-----111 等待连接");
                Socket socket = serverSocket.accept();
                System.out.println("-----222 成功连接:  "+ IdUtil.simpleUUID());
                System.out.println();
            }
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
}
